{
  // enum关键字表示枚举类型，不赋值默认从0开始，若赋值，后面的值++，字符串无法推断，需写全
  enum direction{
    up,
    down,
    left,
    right
  }
  enum direction2{
    up=100,
    down,
    left,
    right
  }
  enum direction3{
    up="上",
    down="下",
    left="左",
    right="右"
  }
  function getDirection(direction:direction){
    console.log(direction)
  }
  getDirection(direction.up)
  getDirection(direction.down)

  function getDirection2(direction:direction2){
    console.log(direction)
  }
  getDirection2(direction2.up)
  getDirection2(direction2.down)

  function getDirection3(direction:direction3){
    console.log(direction)
  }
  getDirection3(direction3.up)
  getDirection3(direction3.down)
}